<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:a="livcos.org/ns/admin"
	xmlns="http://www.w3.org/1999/XSL/Format"
  exclude-result-prefixes="a">
	
	<xsl:import href="../../base.xsl" />

	<xsl:template match="a:address">
	  <block margin-left="12mm" margin-top="8pt" margin-right="20pt" margin-bottom="4pt"
	    keep-with-previous.within-page="always" keep-with-next.within-page="always">
	    <xsl:value-of select="a:street" />&#160;<xsl:value-of select="a:house" />
	  </block>
	  <block margin-left="12mm" margin-top="4pt" margin-right="20pt" margin-bottom="8pt">
	    <xsl:value-of select="a:country"/>
	    <xsl:text>-</xsl:text>
	    <xsl:value-of select="a:zipCode"/>&#160;<xsl:value-of select="a:city"/>
	  </block>
	</xsl:template>
	
	<xsl:template match="a:address[@ref]">
	  <xsl:apply-templates select="/*/*/a:address[@id = current()/@ref]" />
	</xsl:template>
	
  <xsl:template match="a:phone">
    <external-graphic src="{$toDomainPath}/web/img/phone.content" content-height="8pt"
      content-width="7pt"/>
    <xsl:text> +</xsl:text>
    <xsl:value-of select="@country"/>
    <xsl:text> (0</xsl:text>
    <xsl:value-of select="@area"/>
    <xsl:text>) </xsl:text>
    <xsl:value-of select="substring(@number,1,3)"/>
    <xsl:text>&#160;</xsl:text>
    <xsl:value-of select="substring(@number,4)"/>
  </xsl:template>
	
  <xsl:template match="a:email">
    <external-graphic src="{$toDomainPath}/web/img/mail.content" content-height="6pt"
      content-width="8.4pt"/>
    <xsl:text>&#160;</xsl:text>
    <xsl:value-of select="@name"/>
    <xsl:text>@</xsl:text>
    <xsl:value-of select="@domain"/>
  </xsl:template>
	
</xsl:stylesheet>
